<%#-- copyright
OpenProject is an open source project management software.
Copyright (C) 2012-2020 the OpenProject GmbH

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 3.

OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
Copyright (C) 2006-2017 Jean-Philippe Lang
Copyright (C) 2010-2013 the ChiliProject Team

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

See docs/COPYRIGHT.rdoc for more details.

++#%>

<%= render partial: 'shared/costs_header' %>

<% html_title l(:label_administration), t(:label_cost_type_plural) %>
<%= toolbar title: CostType.model_name.human(count: 2) do %>
  <li class="toolbar-item">
    <a href="<%= new_cost_type_path %>" aria-label="<%= t(:button_add_cost_type) %>" title="<%= t(:button_add_cost_type) %>" class="button -alt-highlight">
      <%= op_icon('button--icon icon-add') %>
      <span class="button--text"><%= CostType.model_name.human %></span>
    </a>
  </li>
<% end %>

<%= styled_form_tag(cost_types_path, { method: :get, id: 'query_form' }) do %>
  <fieldset id="filters" class="simple-filters--container">
    <legend><%= t(:label_filter_plural) %></legend>
    <ul class="simple-filters--filters">
      <li class="simple-filters--filter">
        <%= styled_label_tag :fixed_date, t(:label_fixed_date), class: 'simple-filters--filter-name' %>
        <div class='simple-filters--filter-value'>
          <%= styled_text_field_tag :fixed_date, @fixed_date, class: '-augmented-datepicker' %>
        </div>
      </li>
      <li class="simple-filters--filter">
        <%= styled_label_tag :include_deleted, t(:caption_show_locked), class: 'simple-filters--filter-name -small' %>
        <div class="simple-filters--filter-value">
          <%= styled_check_box_tag :include_deleted, "1", @include_deleted, autocomplete: "off" %>
        </div>
      </li>
      <li class="simple-filters--controls">
        <%= submit_tag t(:button_apply), class: 'button -highlight -small' %>
        <%= link_to t(:button_clear), cost_types_path, class: 'button -small -with-icon icon-undo' %>
      </li>
    </ul>
  </fieldset>
<% end %>

<div id="cost_type_flash_notice_outer" style="display:none">
<div class="flash notice" id="cost_type_flash_notice"><%= t(:notice_successful_update) %></div>
</div>
<%= render partial: 'list' %>

<% if @include_deleted %>
  <div class="cost-types--list-deleted">
    <h3><%= t(:label_locked_cost_types) %></h3>
    <%= render partial: 'list_deleted' %>
  </div>
<% end %>
